home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / tcsh / dist / Makefile < prev    next >
Encoding:
Makefile  |  1992-12-18  |  12.5 KB  |  420 lines

  1. # $Id: Makefile,v 1.1 92/12/18 14:23:21 jhh Exp Locker: jhh $
  2. #    Makefile    4.3    6/11/83
  3. #
  4. # C Shell with process control; VM/UNIX VAX Makefile
  5. # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
  6. #
  7. # With an input editor, command completion, etc. and ported to all sorts of
  8. # things; Paul Placeway, CIS Dept., Ohio State University
  9. #
  10. SHELL=/bin/sh
  11. VERSION=6.01
  12. BUILD=tcsh
  13.  
  14. ################################################################
  15. ## CFLAGS.  For various -D things, see config.h
  16. ################################################################
  17. #
  18. # These are the default suffixes from .c to .o and -c to get there
  19. # but to use the global optimizer on the mips boxes, see below
  20. #
  21. SUF=o
  22. CF=-c
  23.  
  24. INCLUDES=-I. -I..
  25.  
  26. #ifdef mips
  27. INCLUDES += -I/sprite/lib/include/ds3100.md /sprite/lib/include
  28. #endif
  29.  
  30. LFLAGS=$(INCLUDES)
  31. #LFLAGS=$(INCLUDES) -Zn10000        # hpux lint
  32.  
  33.  
  34. #CFLAGS= $(INCLUDES) -g            # debug
  35. #CFLAGS= $(INCLUDES) -O            # production
  36. #CFLAGS= $(INCLUDES)             # Broken optimizers....
  37.  
  38. #CFLAGS= -g -pg $(INCLUDES) -DPROF
  39. #CFLAGS= -O -pg $(INCLUDES) -DPROF
  40.  
  41. # gcc 1.37-
  42. #CFLAGS=-O $(INCLUDES) -finline-functions -fstrength-reduce 
  43.  
  44. # gcc 1.37+
  45. #ifdef sun4
  46. CFLAGS=-O $(INCLUDES) -fcombine-regs -finline-functions -fstrength-reduce 
  47. #endif
  48. # add -msoft-float for 68881 machines.
  49.  
  50. #hpux 8.0
  51.  
  52. #CFLAGS=  $(INCLUDES) +O3 -Aa
  53.  
  54. # for silicon graphics (and other mips compilers) -- use the
  55. # global optimizer! (-O3).
  56. # On SGI 4.0+ you need to add -D__STDC__ too.
  57. #CFLAGS= -O3 $(INCLUDES) 
  58. #CF=-j
  59. #SUF=u
  60. #.SUFFIXES: .u                 ## Ultrix needs that
  61.  
  62. # mips systems
  63. #ifdef mips
  64. CFLAGS= $(INCLUDES) -O -systype bsd43 -Wf,-XNd5000 -Wf,-XNp6000 -Olimit 2000 -Dsprite -Uultrix
  65. #endif
  66.  
  67. # for at&t machines
  68. #CFLAGS= -O -Ksd $(INCLUDES)
  69.  
  70. # for convexen
  71. #CFLAGS= $(INCLUDES) -ext -tm c1
  72.  
  73. # Stardent Titan
  74. #CFLAGS = $(INCLUDES) -O -43
  75.  
  76. # Stardent Stellar
  77. #CFLAGS = $(INCLUDES) -O4
  78.  
  79. # Apollo's with cc [apollo builtins don't work with gcc]
  80. # and apollo should not define __STDC__ if it does not have
  81. # the standard header files. RT's (aos4.3) need that too;
  82. # you might want to skip the -O on the rt's... Not very wise.
  83. # AIX/ESA needs -D_IBMESA on command line (this may disappear by GA)
  84. #DFLAGS=-U__STDC__ 
  85. #DFLAGS=-D_IBMESA
  86. # On aix2.2.1 we need more compiler space.
  87. #DFLAGS=-Nd4000 -Nn3000
  88. DFLAGS=
  89.  
  90.  
  91. ################################################################
  92. ## LDLAGS.  Define something here if you need to
  93. ################################################################
  94. LDFLAGS=             ## The simplest, suitable for all.
  95. #LDFLAGS= -s            ## Stripped. Takes less space on disk.
  96. #LDFLAGS= -s -n            ## Pure executable. Spares paging over
  97. #                 ## the network for machines with local
  98. #                ## swap but external /usr/local/bin .
  99. #LDFLAGS= -s -n -Bstatic    ## Without dynamic links. (SunOS)
  100.  
  101. ################################################################
  102. ## LIBES.  Pick one, or roll your own.
  103. ################################################################
  104. LIBES= -ltermcap        ## BSD style things, hpux
  105. #LIBES= -ltermcap -lcs        ## Mach
  106. #LIBES= -lcurses        ## Sys V3 w/o networking (and Sys V4)
  107. #LIBES= -lcurses -lc /usr/ucblib/libucb.a ## Sys V4 with BSDTIMES
  108. #LIBES= -lcurses        ## Sys V4 w/o BSDTIMES
  109. #LIBES= -lcurses -lnet        ## Sys V3 with networking
  110. #LIBES= -lcurses -ldir        ## Sys V2 w/o networking [needs directory lib]
  111. #LIBES= -lcurses -ldir -lnet    ## Sys V2 with networking [needs directory lib]
  112. #LIBES= -lcurses -lsocket -lbsd    ## Amdahl UTS 2.1
  113. #LIBES= -lcurses -lbsd        ## For Irix3.1 on SGI-IRIS4D or ETA10
  114. #LIBES= -lcurses -lsun -lbsd -lc_s ## For Irix3.3 on SGI-IRIS4D (w/ yp)
  115. #LIBES= -lcurses -lbsd -lc_s    ## For Irix3.3 on SGI-IRIS4D (wo/ yp)
  116. #LIBES= -lcurses -lbsd        ## For aix on an IBM 370 or rs6000 or ps2
  117. #LIBES= -lcurses        ## For aix on the rt
  118. #LIBES= -lcurses -lcposix    ## ISC 2.2 
  119. #LIBES= -lcposix -lc_s -lcurses -linet ## ISC 2.2 with networking
  120. #LIBES= -lcurses -linet -lc_s   ## ISC 2.0.2 with networking
  121. #LIBES= -ltermcap -ldir -lx    ## Xenix 386 style things
  122. #LIBES= -lcurses -lintl        ## SCO SysVR3.2v2.0
  123. #LIBES= -lcurses -lintl -lsocket ## SCO+ODT1.1
  124. #LIBES= -lposix -ltermcap    ## A/UX 2.0
  125. #LIBES= -ltermcap -lseq        ## Sequent's Dynix
  126. #LIBES= -lcurses -lsocket    ## Intel's hypercube and ns32000 based Opus.
  127. #LIBES= -ldirent -lcurses       ## att3b1 stk cc w/o shared lib & directory lib
  128. #LIBES= -shlib -ldirent -lcurses ## att3b1 gcc1.40 w/ shared lib & directory lib
  129. #LIBES=                ## Minix.
  130. #LIBES= -lcurses        ## For a stellar
  131.  
  132.  
  133. # The difficult choice of a c-compiler...
  134. # First, you should try your own c-compiler. 
  135. # Gcc -traditional is also a safe choice. 
  136. # If you think that you have good include files try gcc -Wall...
  137. # If you want to take out -traditional, make sure that your sys/ioctl.h
  138. # is fixed correctly, otherwise you'll be stopped for tty input!
  139. #ifdef sun4
  140. CC=    gcc -Wall 
  141. #endif
  142. #ifdef mips
  143. CC = cc
  144. #endif
  145. #CC=    cc
  146. #CC=    occ
  147. #CC=    /bin/cc    # For suns, w/o gcc and SVR4
  148. #CC=    /usr/lib/sun.compile/cc  # FPS 500 (+FPX) with Sun C compiler
  149. ED=    -ed
  150. AS=    -as
  151. RM=    -rm
  152. CXREF=    /usr/ucb/cxref
  153. VGRIND=    csh /usr/ucb/vgrind
  154. CTAGS=    /usr/ucb/ctags
  155. #XSTR= /usr/ucb/xstr
  156. SCCS=    /usr/local/sccs
  157. PARALLEL=12                # Make the multi-max run fast.
  158. #P=&                    # Use Sequent's parallel make
  159. P=
  160. DESTDIR=/sprite
  161. MANSECT=1
  162. DESTBIN=${DESTDIR}/bin
  163. DESTMAN=${DESTDIR}/man/cmds
  164. FTPAREA=/usr/spool/ftp
  165.  
  166. ASSRCS=    sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
  167.     sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
  168.     sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
  169.     sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h 
  170. PSSRCS= sh.decls.h glob.c glob.h mi.termios.c mi.wait.h
  171. SHSRCS= ${ASSRCS} ${PSSRCS}
  172. SHOBJS=    sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
  173.     sh.char.${SUF} sh.exp.${SUF} sh.func.${SUF} sh.glob.${SUF} \
  174.     sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} sh.misc.${SUF} \
  175.     sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} sh.sem.${SUF} \
  176.     sh.set.${SUF} sh.time.${SUF} glob.${SUF} mi.termios.${SUF}
  177.  
  178. TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c
  179. TWOBJS=    tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF}
  180.  
  181. EDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
  182.     ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
  183. EDOBJS=    ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
  184.     ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}
  185.  
  186. TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
  187.     tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
  188.     tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
  189.     tc.who.c tc.h
  190. TCOBJS=    tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.disc.${SUF} \
  191.     tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \
  192.     tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
  193.     tc.vers.${SUF} tc.who.${SUF} 
  194.  
  195. PVSRCS= Makefile
  196. AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \
  197.     WishList config_f.h eight-bit.me glob.3 patchlevel.h \
  198.     pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
  199.     README.imake
  200. VHSRCS=${PVSRCS} ${AVSRCS}
  201.  
  202. CONFSRCS=config/config.* 
  203.  
  204. ALLSRCS=  ${SHSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${VHSRCS}
  205. DISTSRCS= ${PSSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${AVSRCS}
  206.  
  207.  
  208. OBJS= ${SHOBJS} ${TWOBJS} ${EDOBJS} ${TCOBJS}
  209.  
  210.  
  211. all: ${BUILD}
  212.  
  213. tcsh:$(P) ${OBJS} 
  214.     rm -f tcsh core
  215.     ${CC} ${LDFLAGS} ${CFLAGS} ${OBJS} -o tcsh ${LIBES}
  216.  
  217. tcsh.ps: tcsh.1
  218.     rm -f tcsh.ps
  219.     -ptroff -man tcsh.1 > tcsh.ps
  220.  
  221.  
  222. .c.${SUF}:
  223.     ${CC} ${CF} ${CFLAGS} ${DFLAGS} $<
  224.  
  225. # Don't do any special massaging of C files for sharing of strings!!
  226. # it causes weird segmentation faults on some systems.
  227. #.c.o:
  228. #    ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
  229. #    ${CC} ${CF} ${CFLAGS} x.c 
  230. #    mv -f x.o $*.o
  231. #    rm -f x.c
  232.  
  233. #ed.init.o: ed.init.c
  234. #    ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
  235. #    ${CC} -R ${CF} ${CF} x.c 
  236. #    mv -f x.o $*.o
  237. #    rm -f x.c
  238.  
  239. #strings.o: strings
  240. #    ${XSTR}
  241. #    ${CC} -c -R xs.c
  242. #    mv -f xs.o strings.o
  243. #    rm -f xs.c
  244.  
  245. ##.DEFAULT:
  246. ##    ${SCCS} get $<
  247.  
  248. ##.DEFAULT:
  249. ##    co $<
  250.  
  251. ed.defns.h: ed.defns.c
  252.     @rm -f $@
  253.     @echo '/* Do not edit this file, make creates it. */' > $@
  254.     @echo '#ifndef _h_ed_defns' >> $@
  255.     @echo '#define _h_ed_defns' >> $@
  256.     egrep '[FV]_' ed.defns.c | egrep '^#define' >> $@
  257.     @echo '#endif /* _h_ed_defns */' >> $@
  258.  
  259. sh.err.h: sh.err.c
  260.     @rm -f $@
  261.     @echo '/* Do not edit this file, make creates it. */' > $@
  262.     @echo '#ifndef _h_sh_err' >> $@
  263.     @echo '#define _h_sh_err' >> $@
  264.     egrep 'ERR_' sh.err.c | egrep '^#define' >> $@
  265.     @echo '#endif /* _h_sh_err */' >> $@
  266.  
  267. tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
  268.     @rm -f $@
  269.     @echo '/* Do not edit this file, make creates it. */' > $@
  270.     ${CC} -E $(INCLUDES) ${DFLAGS} tc.const.c | egrep 'Char STR' | \
  271.         sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
  272.         sort >> $@
  273.  
  274. csh.prof: ${OBJS} sh.prof.${SUF} mcrt0.${SUF}
  275.     rm -f csh.prof
  276.     ld -X mcrt0.${SUF} ${OBJS} -o csh.prof ${LIBES} -lc
  277.  
  278. sh.prof.${SUF}:
  279.     cp sh.c sh.prof.c
  280.     ${CC} ${CF} ${CFLAGS} -DPROF sh.prof.c
  281.  
  282. lint: tc.const.h ed.defns.h
  283.     lint ${LFLAGS} sh*.c tw*.c ed*.c tc.*.c ${LIBES}
  284.  
  285. print:
  286.     @pr READ_ME
  287.     @pr makefile makefile.*
  288.     @(size -l a.out; size *.${SUF}) | pr -h SIZES
  289.     @${CXREF} sh*.c | pr -h XREF
  290.     @ls -l | pr 
  291.     @pr sh*.h [a-rt-z]*.h sh*.c alloc.c
  292.  
  293. vprint:
  294.     @pr -l84 READ_ME TODO
  295.     @pr -l84 makefile makefile.*
  296.     @(size -l a.out; size *.${SUF}) | pr -l84 -h SIZES
  297.     @${CXREF} sh*.c | pr -l84 -h XREF
  298.     @ls -l | pr -l84
  299.     @${CXREF} sh*.c | pr -l84 -h XREF
  300.     @pr -l84 sh*.h [a-rt-z]*.h sh*.c alloc.c
  301.  
  302. vgrind:
  303.     @cp /dev/null index
  304.     @for i in *.h; do vgrind -t -h "C Shell" $$i >/crp/bill/csh/$$i.t; done
  305.     @for i in *.c; do vgrind -t -h "C Shell" $$i >/crp/bill/csh/$$i.t; done
  306.     @vgrind -t -x -h Index index >/crp/bill/csh/index.t
  307.  
  308. install: tcsh 
  309.     -mv  ${DESTBIN}/tcsh  ${DESTBIN}/tcsh.old
  310.     cp tcsh ${DESTBIN}/tcsh
  311.     strip ${DESTBIN}/tcsh
  312.     chmod 555 ${DESTBIN}/tcsh
  313.  
  314. manpage: tcsh.man
  315.     cp tcsh.man ${DESTMAN}
  316.     chmod 444 ${DESTMAN}/tcsh.man
  317.  
  318. clean:
  319.     ${RM} -f a.out strings x.c xs.c tcsh _MAKE_LOG core
  320.     ${RM} -f *.${SUF} sh.prof.c ed.defns.h tc.const.h sh.err.h
  321.  
  322. veryclean: clean
  323.     ${RM} -f *~ #*
  324.  
  325. tags:    /tmp
  326.     ${CTAGS} sh*.c
  327.  
  328. tar:
  329.     rm -f tcsh-${VERSION}.tar.Z
  330.     rm -rf tcsh-${VERSION} 
  331.     mkdir tcsh-${VERSION} tcsh-${VERSION}/config
  332.     cp ${ALLSRCS} tcsh-${VERSION}
  333.     cp ${CONFSRCS} tcsh-${VERSION}/config
  334.     tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z
  335.     rm -rf tcsh-${VERSION}
  336.  
  337. shar:    
  338.     rm -f tcsh-*.shar
  339.     rm -rf tcsh-${VERSION} 
  340.     mkdir tcsh-${VERSION} tcsh-${VERSION}/config 
  341.     cp ${ALLSRCS} tcsh-${VERSION}
  342.     cp ${CONFSRCS} tcsh-${VERSION}/config
  343.     MAKESHAR ${VERSION} tcsh-${VERSION}/* tcsh-${VERSION}/config/*
  344.     rm -rf tcsh-${VERSION}
  345.  
  346. tcsh-${VERSION}.tar.Z:
  347.     rm -rf tcsh-${VERSION} 
  348.     rm -f tcsh-${VERSION}.tar tcsh-${VERSION}.tar.Z DIFFS.[123]
  349.     mkdir tcsh-${VERSION}
  350.     ./MAKEDIFFS bsd
  351.     mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh-${VERSION}
  352.     cp ${DISTSRCS} tcsh-${VERSION}
  353.     mkdir tcsh-${VERSION}/config
  354.     cp ${CONFSRCS} tcsh-${VERSION}/config
  355.     cp Makefile tcsh-${VERSION}/Makefile.new
  356.     tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z
  357.     rm -rf tcsh-${VERSION}
  358.  
  359. tcsh.tahoe-${VERSION}.tar.Z:
  360.     rm -rf tcsh.tahoe-${VERSION} 
  361.     rm -f tcsh.tahoe-${VERSION}.tar tcsh.tahoe-${VERSION}.tar.Z DIFFS.[123]
  362.     mkdir tcsh.tahoe-${VERSION}
  363.     ./MAKEDIFFS tahoe
  364.     mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh.tahoe-${VERSION}
  365.     cp ${DISTSRCS} tcsh.tahoe-${VERSION}
  366.     mkdir tcsh.tahoe-${VERSION}/config
  367.     cp ${CONFSRCS} tcsh.tahoe-${VERSION}/config
  368.     cp Makefile tcsh.tahoe-${VERSION}/Makefile.new
  369.     tar cvf - tcsh.tahoe-${VERSION} | compress > tcsh.tahoe-${VERSION}.tar.Z
  370.     rm -rf tcsh.tahoe-${VERSION}
  371.  
  372. tcsh.reno-${VERSION}.tar.Z:
  373.     rm -rf tcsh.reno-${VERSION} 
  374.     rm -f tcsh.reno-${VERSION}.tar tcsh.reno-${VERSION}.tar.Z DIFFS.[123]
  375.     mkdir tcsh.reno-${VERSION}
  376.     ./MAKEDIFFS reno
  377.     mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh.reno-${VERSION}
  378.     cp ${DISTSRCS} tcsh.reno-${VERSION}
  379.     mkdir tcsh.reno-${VERSION}/config
  380.     cp ${CONFSRCS} tcsh.reno-${VERSION}/config
  381.     cp Makefile tcsh.reno-${VERSION}/Makefile.new
  382.     tar cvf - tcsh.reno-${VERSION} | compress > tcsh.reno-${VERSION}.tar.Z
  383.     rm -rf tcsh.reno-${VERSION}
  384.  
  385. ftp: tcsh-${VERSION}.tar.Z tcsh.tahoe-${VERSION}.tar.Z
  386.     cp tcsh-${VERSION}.tar.Z tcsh.tahoe-${VERSION}.tar.Z ${FTPAREA}
  387.     cp tcsh.man ${FTPAREA}
  388.  
  389. #
  390. # Dependencies
  391. #
  392. config.h: config_f.h
  393.  
  394. TCH=tc.h tc.const.h tc.decls.h tc.os.h tc.sig.h
  395. SHH=sh.h sh.types.h sh.char.h sh.err.h sh.dir.h sh.proc.h pathnames.h \
  396.     sh.decls.h ${TCH}
  397. TWH=tw.h tw.decls.h
  398. EDH=ed.h ed.decls.h
  399.  
  400. # EDH
  401. EDINC=sh.${SUF} sh.func.${SUF} sh.lex.${SUF} sh.print.${SUF} sh.proc.${SUF} \
  402.       sh.set.${SUF} tc.bind.${SUF} tc.os.${SUF} tc.prompt.${SUF} \
  403.       tc.sched.${SUF} tw.parse.${SUF}
  404. ${EDOBJS} ${EDINC} : ${EDH}
  405.  
  406. # SHH
  407. ${OBJS}: config.h ${SHH}
  408.  
  409. # TWH
  410. TWINC=ed.chared.${SUF} ed.inputl.${SUF} sh.exec.${SUF} sh.func.${SUF} \
  411.       sh.set.${SUF} tc.func.${SUF}
  412. ${TWOBJS} ${TWINC}: ${TWH}
  413.  
  414. # glob.h
  415. glob.${SUF} sh.glob.${SUF}: glob.h
  416.  
  417. # ed.defns.h
  418. EDDINC=tc.bind.${SUF} tc.func.${SUF} tc.os.${SUF}
  419. ${EDOBJS} ${EDDINC}: ed.defns.h
  420.